<link rel="stylesheet" type="text/css" href="/static/styles/NotificationStyles/css/normalize.css" />
<link rel="stylesheet" type="text/css" href="/static/styles/NotificationStyles/css/ns-default.css" />
<link rel="stylesheet" type="text/css" href="/static/styles/NotificationStyles/css/ns-style-attached.css" />
<script src="/static/styles/NotificationStyles/js/modernizr.custom.js"></script>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<script src="/static/styles/NotificationStyles/js/classie.js"></script>
<script src="/static/styles/NotificationStyles/js/notificationFx.js"></script>
{{csrf_token()}}
<?php echo csrf_token(); ?>
<script>
    (function() {
        var bttn = document.getElementById( 'contact_submit' );

        // make sure..
        bttn.disabled = false;

        bttn.addEventListener( 'click', function() {
            // simulate loading (for demo purposes only)
            classie.add( bttn, 'active' );

            f_name=$('#f_name').val();
            f_email=$('#f_email').val();
            f_mobile=$('#f_mobile').val();
            f_content=$('#f_content').val();


            $.post("/submit_comment", { "name":f_name,"email":f_email,"mobile":f_mobile,"content":f_content,"_token":"{{csrf_token()}}"  },
                    function(data){
                        setTimeout( function() {
                            classie.remove( bttn, 'active' );
                            // create the notification
                            var notification = new NotificationFx({
                                message : '<p>'+data.message+'</p>',
                                layout : 'attached',
                                effect : 'flip',
                                type : 'notice', // notice, warning or error
                                onClose : function() {
                                    bttn.disabled = false;
                                }
                            });
                            // show the notification
                            notification.show();
                            if(data.status==1){
                                $('#f_name,#f_email,#f_mobile,#f_content').val('');
                                $('#f_name,#f_email,#f_mobile,#f_content').blur();
                                $(".ns-show").css({'background-color': '#30A79D'});
                            }else{
                                $(".ns-show").css({'background-color': 'red'});
                            }
                        }, 1200 );





                    }, "json");








            // disable the button (for demo purposes only)
            this.disabled = true;
        } );
    })();
</script>